package com.maple.tag;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;

public class ParamTag extends TagSupport{
	private String name;
	private String value;
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Override
	public int doStartTag() throws JspException {
		HttpServletRequest  request=(HttpServletRequest) this.pageContext.getRequest();
		JspWriter out=pageContext.getOut();
		PageTag pageProcesser= (PageTag) TagSupport.findAncestorWithClass(this, PageTag.class);
		pageProcesser.setValue(this.name, this.value);	
		return Tag.EVAL_BODY_INCLUDE;
	}
     
}
